<script type="text/javascript" language="javascript">
 $(document).ready(
         function() {
             $("#forgotlink").click(function(e) {
                 e.preventDefault();
                 $('#forgot').toggle("slide");

             });
         });
</script>

<% if flash[:error] %>
    <div class="flash error"><p><%= flash[:error] %></p></div>
<% end %>
<% if flash[:notice] %>
    <div class="flash notice"><p><%= flash[:notice] %></p></div>
<% end %>

<h1>Log In</h1>

<div class="intro">
<%= form_tag session_path do -%>
<p><%= label_tag 'login' %><br />
<%= text_field_tag 'login', @login %></p>

<p><%= label_tag 'password' %><br/>
<%= password_field_tag 'password', nil %></p>

<!-- Uncomment this if you want this functionality
<p><%= label_tag 'remember_me', 'Remember me' %>
<%= check_box_tag 'remember_me', '1', @remember_me %></p>
-->

<p><%= submit_tag 'Log in' %></p>
<% end -%>

<a href="/signup">Create new account</a>  | <a href="#" id="forgotlink">I forgot my password!</a>
</div>

<br />
<%= form_for :user, :url => 'forgot_password' do |form| %>
    <div id="forgot" style="display:none;">
      <h3>Reset Your Password</h3>
      <label for="user_email" >Enter your email address below to reset your password: </label><br/> <br />
      <%= form.text_field :email, :size => 40, :class => 'text' %>
      <%= submit_tag 'Send' %>
    </div>
    <br/>
<% end %>